/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.misena.praxispraktik.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author SENA
 */
@Entity
@Table(name = "instructores")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Instructores.findAll", query = "SELECT i FROM Instructores i"),
    @NamedQuery(name = "Instructores.findByIdInstructores", query = "SELECT i FROM Instructores i WHERE i.idInstructores = :idInstructores")})
public class Instructores implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idInstructores")
    private Integer idInstructores;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idInstructores")
    private Collection<Seguimientos> seguimientosCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idInstructores")
    private Collection<Instructoresespecialidades> instructoresespecialidadesCollection;
    @JoinColumn(name = "idPersonas", referencedColumnName = "idPersonas")
    @ManyToOne(optional = false)
    private Personas idPersonas;

    public Instructores() {
    }

    public Instructores(Integer idInstructores) {
        this.idInstructores = idInstructores;
    }

    public Integer getIdInstructores() {
        return idInstructores;
    }

    public void setIdInstructores(Integer idInstructores) {
        this.idInstructores = idInstructores;
    }

    @XmlTransient
    public Collection<Seguimientos> getSeguimientosCollection() {
        return seguimientosCollection;
    }

    public void setSeguimientosCollection(Collection<Seguimientos> seguimientosCollection) {
        this.seguimientosCollection = seguimientosCollection;
    }

    @XmlTransient
    public Collection<Instructoresespecialidades> getInstructoresespecialidadesCollection() {
        return instructoresespecialidadesCollection;
    }

    public void setInstructoresespecialidadesCollection(Collection<Instructoresespecialidades> instructoresespecialidadesCollection) {
        this.instructoresespecialidadesCollection = instructoresespecialidadesCollection;
    }

    public Personas getIdPersonas() {
        return idPersonas;
    }

    public void setIdPersonas(Personas idPersonas) {
        this.idPersonas = idPersonas;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idInstructores != null ? idInstructores.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Instructores)) {
            return false;
        }
        Instructores other = (Instructores) object;
        if ((this.idInstructores == null && other.idInstructores != null) || (this.idInstructores != null && !this.idInstructores.equals(other.idInstructores))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.praxispraktik.entity.Instructores[ idInstructores=" + idInstructores + " ]";
    }
    
}
